/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package algorithm;

import weka.classifiers.lazy.IBk;
import weka.classifiers.trees.Id3;
import weka.core.Instances;

/**
 *
 * @author Winzelric
 */
public class KNearestNeighbour {
  
  public KNearestNeighbourModel  KNearestNeighbourWEKA(Instances data) {
    try {
      IBk classifier = new IBk();
      classifier.buildClassifier(data);
      return new KNearestNeighbourModel(classifier);
    } catch (Exception e) {
      System.out.println(e);
      return null;
    }
  }

  public KNearestNeighbourModel generateModel(Instances arr, int k) {
    return new KNearestNeighbourModel(arr, k);
  }
}
